package acm;

import java.io.PrintStream;
import java.util.Scanner;

public class FeGeNumFigure
{
	static Scanner in;
	static PrintStream out;
	
	public static void main(String[] args)
	{
		in = new Scanner(System.in);
		out = System.out;
		
		for ( int i=in.nextInt(); i>0; i-- )
		{
			figure();
		}
	}
	
	private static void figure()
	{
		int num = in.nextInt();
		
		int begin = num * 618 / 1000;
		int end = num * 619 / 1000;
		
		boolean flagAnswer = false;
		
		for ( ; begin<end; begin++ )
		{
			int loop1 = begin;
			int loop2 = num;
			
			boolean flag = true;
			
			for ( int i=0; i<9; i++ )
			{
				loop2 = loop2 - loop1;
				loop1 = loop1 - loop2;
				
				if(loop2 < 0 || loop1 < 0)
				{
					flag = false;
					break;
				}
			}
			
			if ( flag == true )
			{
				flagAnswer = true;
				out.println(loop1 + " " + loop2);
			}
		}
		
		if ( flagAnswer == false )
		{
			out.println("No answer");
		}
	}
}
